﻿using BlazorPro.BlazorSize;
using SageKing.UI.Blazor.SageKingAntDesign.Services;
using SageKing.UI.Razor.Base.Features;

namespace SageKing.UI.Blazor.SageKingAntDesign.Features;

[DependsOn(typeof(SageKingUIRazorBaseFeature))]
public class SageKingAntDesignFeature : FeatureBase
{
    public SageKingAntDesignFeature(IModule module) : base(module)
    {
    }

    /// <summary>
    /// AntDesignOptions
    /// </summary>
    public Action<SageKingAntDesignOptions> AntDesignServiceConfiguration { get; set; } = _ => { };

    /// <summary>
    /// ResizeOptions
    /// </summary>
    public Action<ResizeOptions> ResizeOptionsConfiguration { get; set; } = (options) =>
    {

        options.ReportRate = 300;
        options.EnableLogging = true;
        options.SuppressInitEvent = true;

        
    };
    /// <inheritdoc />
   public override void Apply(IConfigurationManager configurationManager, IHostEnvironment hostEnvironment)
    {
        Services.Configure(AntDesignServiceConfiguration)
            .AddMediaQueryService()
            .AddResizeListener(ResizeOptionsConfiguration)
            .AddScoped<AntDesignIconListService>()
            .AddAntDesign()
           ;
    }
}
